<template>
	<!-- 添加模板 -->
	<div class="HomePage">
		<div class="location">
			<div class="location-text fl">
				<img class="location-img fl" src="../../images/BaseManager/add.png" />
				<p class="fr">{{template.id == null ? "添加模板" : "编辑模板"}}</p>
			</div>
			<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
		</div>
		<div class="IssuedNotice-box">
			<form id="templateForm" class="form-box">
        <input name="id" type="hidden" :value="template.id"/>
        <div class="form-line input-required">
					<label>模板名称：</label>
					<div class="input-box">
						<input name="name" type="text" :value="template.name">
					</div>
				</div>
        <div class="form-line input-required">
          <label>类型：</label>
          <div class="input-box">
            <select name="type">
              <option value="">请选择类型</option>
              <option value="1" :selected="template.type == 1 ? true : false">基地申请</option>
              <option value="2" :selected="template.type == 2 ? true : false">项目申报</option>
              <option value="3" :selected="template.type == 3 ? true : false">项目申请</option>
              <option value="4" :selected="template.type == 4 ? true : false">合作合同</option>
              <option value="5" :selected="template.type == 5 ? true : false">任务书</option>
              <option value="6" :selected="template.type == 6 ? true : false">中期报告</option>
              <option value="7" :selected="template.type == 7 ? true : false">结题报告</option>
            </select>
          </div>
        </div>
				<div class="search-boxs imgbox">
					<label>附件：</label>
					<input name="url" type="hidden" :value="template.url"/>
					<input type="file" id="handIdFront" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*"
					 @change="idFrontImg($event)" style="display: none;" />
          <input type="button" value="上传模板" class="delete write" @click="touchOffIdInput(1)"/>
          <input type="button" value="删除模板" class="delete write" @click="deleteEnclosure()"/>
					<ul class="img-box">
						<li id="urlLi"></li>
					</ul>
				</div>
				<input class="save fl" type="button" value="确定" @click="saveData" v-if="template.id == null"/>
        <input class="save fl" type="button" value="确定" @click="updateData" v-else/>
			</form>
		</div>
	</div>
</template>

<script src="./AddTemplate.js"></script>

<style scoped>
	@import "AddTemplate.css"
</style>
